package cn.bearspark.collect.provider.dao.key;

import cn.bearspark.framework.redis.starter.key.RedisKeyBuilder;
import org.springframework.stereotype.Component;

/**
 * 收藏的用户 id 缓存的构键器
 *
 * @author f
 */
@Component
public class CollectUserIdBufferKeyBuilder extends RedisKeyBuilder {

    /**
     * 收藏的用户 id 的 ZSet 缓存的键的前缀
     */
    private static final String COLLECT_USER_ID_ZSET = "collectUserIdZSet";

    public String buildCollectUserIdZSetKey(int moduleCode, long userId) {
        return super.getPrefix() + COLLECT_USER_ID_ZSET +
               super.getSplitItem() + moduleCode +
               super.getSplitItem() + userId;
    }
}
